package newsDemo.pojo;

import lombok.Data;

@Data
public class Result<T> {
    private int status;
    private T date;
    private String message;

    public Result(int status, T date, String message) {
        this.status = status;
        this.date = date;
        this.message = message;
    }

    public static <T> Result<T> success(T date) {
        return new Result(200, date, null);
    }
    public static <T> Result<T> success() {
        return new Result(200, null, null);
    }
    public static <T> Result<T> fail(int date, String message) {
        return new Result(date, null, message);
    }
}
